using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Merge Divided Roads</para>
    /// <para>Generates single-line road features in place of matched pairs of  divided road lanes.</para>
    /// <para>生成单线道路要素，以代替成对的分隔道路车道。</para>
    /// </summary>    
    [DisplayName("Merge Divided Roads")]
    public class MergeDividedRoads : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MergeDividedRoads()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input linear road features that contain matched pairs of divided road lanes that will be merged into a single output line feature.</para>
        /// <para>输入线性道路要素包含将合并为单个输出线要素的已分隔道路车道对。</para>
        /// </param>
        /// <param name="_merge_field">
        /// <para>Merge Field</para>
        /// <para>The field that contains road classification information. Only parallel, proximate roads of equal classification will be merged. A value of 0 (zero) locks a feature to prevent it from participating in merging.</para>
        /// <para>包含道路分类信息的字段。只有同等分类的平行、相邻的道路才会合并。值为 0（零）将锁定要素以防止其参与合并。</para>
        /// </param>
        /// <param name="_merge_distance">
        /// <para>Merge Distance</para>
        /// <para>The minimum distance apart, in the specified units, for equal-class, relatively parallel road features to be merged. This distance must be greater than zero. If the units are in points, millimeters, centimeters, or inches, the value is considered as page units and takes into account the reference scale.</para>
        /// <para>要合并的相等等级、相对平行的道路要素的最小间隔距离（以指定单位表示）。此距离必须大于零。如果单位以磅、毫米、厘米或英寸为单位，则该值被视为页面单位，并考虑参考比例。</para>
        /// </param>
        /// <param name="_out_features">
        /// <para>Output Features</para>
        /// <para>The output feature class containing single-line merged road features and all unmerged road features.</para>
        /// <para>包含单线合并道路要素和所有未合并道路要素的输出要素类。</para>
        /// </param>
        public MergeDividedRoads(object _in_features, object _merge_field, string? _merge_distance, object _out_features)
        {
            this._in_features = _in_features;
            this._merge_field = _merge_field;
            this._merge_distance = _merge_distance;
            this._out_features = _out_features;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Merge Divided Roads";

        public override string CallName => "cartography.MergeDividedRoads";

        public override List<string> AcceptEnvironments => ["cartographicCoordinateSystem", "cartographicPartitions", "referenceScale", "workspace"];

        public override object[] ParameterInfo => [_in_features, _merge_field, _merge_distance, _out_features, _out_displacement_features, _character_field, _out_table];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input linear road features that contain matched pairs of divided road lanes that will be merged into a single output line feature.</para>
        /// <para>输入线性道路要素包含将合并为单个输出线要素的已分隔道路车道对。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Merge Field</para>
        /// <para>The field that contains road classification information. Only parallel, proximate roads of equal classification will be merged. A value of 0 (zero) locks a feature to prevent it from participating in merging.</para>
        /// <para>包含道路分类信息的字段。只有同等分类的平行、相邻的道路才会合并。值为 0（零）将锁定要素以防止其参与合并。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Merge Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _merge_field { get; set; }


        /// <summary>
        /// <para>Merge Distance</para>
        /// <para>The minimum distance apart, in the specified units, for equal-class, relatively parallel road features to be merged. This distance must be greater than zero. If the units are in points, millimeters, centimeters, or inches, the value is considered as page units and takes into account the reference scale.</para>
        /// <para>要合并的相等等级、相对平行的道路要素的最小间隔距离（以指定单位表示）。此距离必须大于零。如果单位以磅、毫米、厘米或英寸为单位，则该值被视为页面单位，并考虑参考比例。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Merge Distance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _merge_distance { get; set; }


        /// <summary>
        /// <para>Output Features</para>
        /// <para>The output feature class containing single-line merged road features and all unmerged road features.</para>
        /// <para>包含单线合并道路要素和所有未合并道路要素的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_features { get; set; }


        /// <summary>
        /// <para>Output Displacement Feature Class</para>
        /// <para>The output polygon features containing the degree and direction of road displacement.</para>
        /// <para>输出面要素包含道路位移的程度和方向。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Displacement Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_displacement_features { get; set; } = null;


        /// <summary>
        /// <para>Road Character Field</para>
        /// <para><xdoc>
        ///   <para>Specify a numeric field that indicate the character of road segments, independent of their road classification. These values help the tool to refine the assessment of candidate feature pairs for merging. Use this parameter in unusual or complex road networks to improve the quality of the output. If there are null values (or if this parameter is not specified at all), the road character (and merge candidacy) is based only on the shapes and arrangement of features. Use value 999 to lock features from participating in a merge at all.</para>
        ///   <para>Field values are assessed as follows:
        ///   <bulletList>
        ///     <bullet_item>0—Traffic circles or roundabouts  </bullet_item><para/>
        ///     <bullet_item>1—Carriageways, boulevards, dual-lane highways, or other parallel trending roads  </bullet_item><para/>
        ///     <bullet_item>2—On- or off-ramps, highway intersection connectors  </bullet_item><para/>
        ///     <bullet_item>999—Features will not be merged  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定一个数值字段，用于指示路段的特征，而与路段的分类无关。这些值有助于工具优化对候选特征对的评估，以便进行合并。在不寻常或复杂的道路网络中使用此参数可提高输出质量。如果存在空值（或者根本没有指定此参数），则道路字符（和合并候选）仅基于要素的形状和排列。使用值 999 完全锁定要素参与合并。</para>
        /// <para>字段值的评估如下：
        ///   <bulletList>
        ///     <bullet_item>0 - 交通圈或环形交叉路口</bullet_item><para/>
        ///     <bullet_item>1 - 行车道、林荫大道、双车道高速公路或其他平行趋势道路</bullet_item><para/>
        ///     <bullet_item>2 - 入口或出口匝道、高速公路交叉口连接器</bullet_item><para/>
        ///     <bullet_item>999 - 要素不会被合并</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Road Character Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _character_field { get; set; } = null;


        /// <summary>
        /// <para>Output Table</para>
        /// <para>A many-to-many relationship table that links the merged road features to their source features. This table contains two fields, OUTPUT_FID and INPUT_FID, which store the merged feature IDs and their source feature IDs, respectively. Use this table to derive necessary attributes for the output features from their source features. No table is created when this parameter is left blank.</para>
        /// <para>将合并的道路要素链接到其源要素的多对多关系表。此表包含两个字段 OUTPUT_FID 和 INPUT_FID，它们分别存储合并的要素 ID 及其源要素 ID。使用此表可从输出要素的源要素中派生出输出要素的必要属性。如果此参数留空，则不会创建任何表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_table { get; set; } = null;


        public MergeDividedRoads SetEnv(object cartographicCoordinateSystem = null, object cartographicPartitions = null, object referenceScale = null, object workspace = null)
        {
            base.SetEnv(cartographicCoordinateSystem: cartographicCoordinateSystem, cartographicPartitions: cartographicPartitions, referenceScale: referenceScale, workspace: workspace);
            return this;
        }

    }

}